package com.iwinding.ladygg.bluetooth.ibluetooth;

import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.Context;

/**
 * Created by 82218 on 2017/7/12.
 */

public interface IBleFunction {

    int SCAN_PERIOD = 5 * 1000;//扫描时间

    //    int SERVICE_BIND = 100;//绑定
//    int SERVICE_OPEN = 101;//打开
//    int SCAN_FINSH = 102;//扫描完成
//    int CONNET_NEXT = 103;//连接下一个
//    int CLOSE_BLE = 104;//关闭蓝牙
//    int DISCONNECTED = 106;//断开连接
//    int CONNECTING = 107;//连接成功
//    int SERVICE_SHOW = 108;//展示
//    int PAIRING_REQUEST = 1000;//展示
//    int ACTION_FOUND = 1001;//展示
    int SERVICE_BIND = 100;//绑定成功
    int SERVICE_OPEN = 101;//蓝牙打开
    int SCAN_FINSH = 102;//扫描完成
    int CONNET_NEXT = 103;//连接下一个
    int CLOSE_BLE = 104;//关闭蓝牙
    int CONNECTING = 105;//连接成功
    int DISCONNECTED = 106;//断开连接
    int SERVICE_SHOW = 108;//展示
    int PAIRING_REQUEST = 1000;//系统接收到蓝牙的弹窗
    int ACTION_FOUND = 1001;//系统发现蓝牙

    void initBle(Context application);

    void setAutoConnBle(IAutoBlelimit blelimit);

    void openBle();

    void scanBle();

    void stopScanBle();

    void connetBle(String address);

    boolean isConnetBle();

    void setPin(Class btClass, BluetoothDevice btDevice,
                String str);

    void setPin(String str);

    void disConnetBle();

    void autoConnetBle();

    String readRssi();

    void setCharacteristic(BluetoothGattCharacteristic characteristic);

    void writeBle(String serviceUUID, String characteristicUUID, byte[] value);

    void closeBle();

    void register(IHandler i);

    void unRegister(IHandler i);

}
